// @ts-nocheck
function dingdingTool(n) {
    ("use strict");
    n = n || { j: 54826 };
    var r = Uint8Array,
        o = Uint16Array,
        i = Uint32Array,
        a = new r([
            0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0,
            0, 0, 0,
        ]),
        s = new r([
            0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12,
            12, 13, 13, 0, 0,
        ]),
        u = new r([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]),
        c = function (e, t) {
            for (var n = new o(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
            var a = new i(n[30]);
            for (r = 1; r < 30; ++r)
                for (var s = n[r]; s < n[r + 1]; ++s) a[s] = ((s - n[r]) << 5) | r;
            return [n, a];
        },
        l = c(a, 2),
        f = l[0],
        h = l[1];
    (f[28] = 258), (h[258] = 28);
    for (var d = c(s, 0), p = d[0], y = d[1], m = new o(32768), v = 0; v < 32768; ++v) {
        var g = ((43690 & v) >>> 1) | ((21845 & v) << 1);
        (g = ((61680 & (g = ((52428 & g) >>> 2) | ((13107 & g) << 2))) >>> 4) | ((3855 & g) << 4)),
            (m[v] = (((65280 & g) >>> 8) | ((255 & g) << 8)) >>> 1);
    }
    var b = function (e, t, n) {
            for (var r = e.length, i = 0, a = new o(t); i < r; ++i) e[i] && ++a[e[i] - 1];
            var s,
                u = new o(t);
            for (i = 0; i < t; ++i) u[i] = (u[i - 1] + a[i - 1]) << 1;
            if (n) {
                s = new o(1 << t);
                var c = 15 - t;
                for (i = 0; i < r; ++i)
                    if (e[i])
                        for (
                            var l = (i << 4) | e[i],
                                f = t - e[i],
                                h = u[e[i] - 1]++ << f,
                                d = h | ((1 << f) - 1);
                            h <= d;
                            ++h
                        )
                            s[m[h] >>> c] = l;
            } else
                for (s = new o(r), i = 0; i < r; ++i)
                    e[i] && (s[i] = m[u[e[i] - 1]++] >>> (15 - e[i]));
            return s;
        },
        w = new r(288);
    for (v = 0; v < 144; ++v) w[v] = 8;
    for (v = 144; v < 256; ++v) w[v] = 9;
    for (v = 256; v < 280; ++v) w[v] = 7;
    for (v = 280; v < 288; ++v) w[v] = 8;
    var _ = new r(32);
    for (v = 0; v < 32; ++v) _[v] = 5;
    var E = 6728 != n.j ? b(w, 9, 0) : null,
        k = 6728 != n.j ? b(w, 9, 1) : null,
        x = 6728 != n.j ? b(_, 5, 0) : null,
        A = 6728 != n.j ? b(_, 5, 1) : null,
        S = function (e) {
            for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
            return t;
        },
        C = function (e, t, n) {
            var r = (t / 8) | 0;
            return ((e[r] | (e[r + 1] << 8)) >> (7 & t)) & n;
        },
        P = function (e, t) {
            var n = (t / 8) | 0;
            return (e[n] | (e[n + 1] << 8) | (e[n + 2] << 16)) >> (7 & t);
        },
        O = function (e) {
            return ((e + 7) / 8) | 0;
        },
        B = function (e, t, n) {
            (null == t || t < 0) && (t = 0), (null == n || n > e.length) && (n = e.length);
            var a = new (2 == e.BYTES_PER_ELEMENT ? o : 4 == e.BYTES_PER_ELEMENT ? i : r)(n - t);
            return a.set(e.subarray(t, n)), a;
        },
        j = [
            "unexpected EOF",
            "invalid block type",
            "invalid length/literal",
            "invalid distance",
            "stream finished",
            "no stream handler",
            ,
            "no callback",
            "invalid UTF-8 data",
            "extra field too long",
            "date not in range 1980-2099",
            "filename too long",
            "stream finishing",
            "invalid zip data",
        ],
        K = function (e, t, n) {
            var r = new Error(t || j[e]);
            if (((r.code = e), Error.captureStackTrace && Error.captureStackTrace(r, K), !n))
                throw r;
            return r;
        },
        T = function (e, t, n) {
            var o = e.length;
            if (!o || (n && n.f && !n.l)) return t || new r(0);
            var i = !t || n,
                c = !n || n.i;
            n || (n = {}), t || (t = new r(3 * o));
            var l = function (e) {
                    var n = t.length;
                    if (e > n) {
                        var o = new r(Math.max(2 * n, e));
                        o.set(t), (t = o);
                    }
                },
                h = n.f || 0,
                d = n.p || 0,
                y = n.b || 0,
                m = n.l,
                v = n.d,
                g = n.m,
                w = n.n,
                _ = 8 * o;
            do {
                if (!m) {
                    h = C(e, d, 1);
                    var E = C(e, d + 1, 3);
                    if (((d += 3), !E)) {
                        var x = e[(q = O(d) + 4) - 4] | (e[q - 3] << 8),
                            j = q + x;
                        if (j > o) {
                            c && K(0);
                            break;
                        }
                        i && l(y + x),
                            t.set(e.subarray(q, j), y),
                            (n.b = y += x),
                            (n.p = d = 8 * j),
                            (n.f = h);
                        continue;
                    }
                    if (1 == E) (m = k), (v = A), (g = 9), (w = 5);
                    else if (2 == E) {
                        var T = C(e, d, 31) + 257,
                            I = C(e, d + 10, 15) + 4,
                            R = T + C(e, d + 5, 31) + 1;
                        d += 14;
                        for (var M = new r(R), L = new r(19), D = 0; D < I; ++D)
                            L[u[D]] = C(e, d + 3 * D, 7);
                        d += 3 * I;
                        var U = S(L),
                            N = (1 << U) - 1,
                            F = b(L, U, 1);
                        for (D = 0; D < R; ) {
                            var q,
                                Z = F[C(e, d, N)];
                            if (((d += 15 & Z), (q = Z >>> 4) < 16)) M[D++] = q;
                            else {
                                var H = 0,
                                    z = 0;
                                for (
                                    16 == q
                                        ? ((z = 3 + C(e, d, 3)), (d += 2), (H = M[D - 1]))
                                        : 17 == q
                                        ? ((z = 3 + C(e, d, 7)), (d += 3))
                                        : 18 == q && ((z = 11 + C(e, d, 127)), (d += 7));
                                    z--;

                                )
                                    M[D++] = H;
                            }
                        }
                        var W = M.subarray(0, T),
                            V = M.subarray(T);
                        (g = S(W)), (w = S(V)), (m = b(W, g, 1)), (v = b(V, w, 1));
                    } else K(1);
                    if (d > _) {
                        c && K(0);
                        break;
                    }
                }
                i && l(y + 131072);
                for (var G = (1 << g) - 1, Y = (1 << w) - 1, Q = d; ; Q = d) {
                    var J = (H = m[P(e, d) & G]) >>> 4;
                    if ((d += 15 & H) > _) {
                        c && K(0);
                        break;
                    }
                    if ((H || K(2), J < 256)) t[y++] = J;
                    else {
                        if (256 == J) {
                            (Q = d), (m = null);
                            break;
                        }
                        var X = J - 254;
                        if (J > 264) {
                            var $ = a[(D = J - 257)];
                            (X = C(e, d, (1 << $) - 1) + f[D]), (d += $);
                        }
                        var ee = v[P(e, d) & Y],
                            te = ee >>> 4;
                        ee || K(3), (d += 15 & ee);
                        V = p[te];
                        if (te > 3) {
                            $ = s[te];
                            (V += P(e, d) & ((1 << $) - 1)), (d += $);
                        }
                        if (d > _) {
                            c && K(0);
                            break;
                        }
                        i && l(y + 131072);
                        for (var ne = y + X; y < ne; y += 4)
                            (t[y] = t[y - V]),
                                (t[y + 1] = t[y + 1 - V]),
                                (t[y + 2] = t[y + 2 - V]),
                                (t[y + 3] = t[y + 3 - V]);
                        y = ne;
                    }
                }
                (n.l = m),
                    (n.p = Q),
                    (n.b = y),
                    (n.f = h),
                    m && ((h = 1), (n.m = g), (n.d = v), (n.n = w));
            } while (!h);
            return y == t.length ? t : B(t, 0, y);
        },
        I = function (e, t, n) {
            n <<= 7 & t;
            var r = (t / 8) | 0;
            (e[r] |= n), (e[r + 1] |= n >>> 8);
        },
        R = function (e, t, n) {
            n <<= 7 & t;
            var r = (t / 8) | 0;
            (e[r] |= n), (e[r + 1] |= n >>> 8), (e[r + 2] |= n >>> 16);
        },
        M = function (e, t) {
            for (var n = [], i = 0; i < e.length; ++i)
                e[i] &&
                    n.push({
                        s: i,
                        f: e[i],
                    });
            var a = n.length,
                s = n.slice();
            if (!a) return [Z, 0];
            if (1 == a) {
                var u = new r(n[0].s + 1);
                return (u[n[0].s] = 1), [u, 1];
            }
            n.sort(function (e, t) {
                return e.f - t.f;
            }),
                n.push({
                    s: -1,
                    f: 25001,
                });
            var c = n[0],
                l = n[1],
                f = 0,
                h = 1,
                d = 2;
            for (
                n[0] = {
                    s: -1,
                    f: c.f + l.f,
                    l: c,
                    r: l,
                };
                h != a - 1;

            )
                (c = n[n[f].f < n[d].f ? f++ : d++]),
                    (l = n[f != h && n[f].f < n[d].f ? f++ : d++]),
                    (n[h++] = {
                        s: -1,
                        f: c.f + l.f,
                        l: c,
                        r: l,
                    });
            var p = s[0].s;
            for (i = 1; i < a; ++i) s[i].s > p && (p = s[i].s);
            var y = new o(p + 1),
                m = L(n[h - 1], y, 0);
            if (m > t) {
                i = 0;
                var v = 0,
                    g = m - t,
                    b = 1 << g;
                for (
                    s.sort(function (e, t) {
                        return y[t.s] - y[e.s] || e.f - t.f;
                    });
                    i < a;
                    ++i
                ) {
                    var w = s[i].s;
                    if (!(y[w] > t)) break;
                    (v += b - (1 << (m - y[w]))), (y[w] = t);
                }
                for (v >>>= g; v > 0; ) {
                    var _ = s[i].s;
                    y[_] < t ? (v -= 1 << (t - y[_]++ - 1)) : ++i;
                }
                for (; i >= 0 && v; --i) {
                    var E = s[i].s;
                    y[E] == t && (--y[E], ++v);
                }
                m = t;
            }
            return [new r(y), m];
        },
        L = function (e, t, n) {
            return -1 == e.s ? Math.max(L(e.l, t, n + 1), L(e.r, t, n + 1)) : (t[e.s] = n);
        },
        D = function (e) {
            for (var t = e.length; t && !e[--t]; );
            for (
                var n = new o(++t),
                    r = 0,
                    i = e[0],
                    a = 1,
                    s = function (e) {
                        n[r++] = e;
                    },
                    u = 1;
                u <= t;
                ++u
            )
                if (e[u] == i && u != t) ++a;
                else {
                    if (!i && a > 2) {
                        for (; a > 138; a -= 138) s(32754);
                        a > 2 &&
                            (s(a > 10 ? ((a - 11) << 5) | 28690 : ((a - 3) << 5) | 12305), (a = 0));
                    } else if (a > 3) {
                        for (s(i), --a; a > 6; a -= 6) s(8304);
                        a > 2 && (s(((a - 3) << 5) | 8208), (a = 0));
                    }
                    for (; a--; ) s(i);
                    (a = 1), (i = e[u]);
                }
            return [n.subarray(0, r), t];
        },
        U = function (e, t) {
            for (var n = 0, r = 0; r < t.length; ++r) n += e[r] * t[r];
            return n;
        },
        N = function (e, t, n) {
            var r = n.length,
                o = O(t + 2);
            (e[o] = 255 & r),
                (e[o + 1] = r >>> 8),
                (e[o + 2] = 255 ^ e[o]),
                (e[o + 3] = 255 ^ e[o + 1]);
            for (var i = 0; i < r; ++i) e[o + i + 4] = n[i];
            return 8 * (o + 4 + r);
        },
        F = function (e, t, n, r, i, c, l, f, h, d, p) {
            I(t, p++, n), ++i[256];
            for (
                var y = M(i, 15),
                    m = y[0],
                    v = y[1],
                    g = M(c, 15),
                    k = g[0],
                    A = g[1],
                    S = D(m),
                    C = S[0],
                    P = S[1],
                    O = D(k),
                    B = O[0],
                    j = O[1],
                    K = new o(19),
                    T = 0;
                T < C.length;
                ++T
            )
                K[31 & C[T]]++;
            for (T = 0; T < B.length; ++T) K[31 & B[T]]++;
            for (var L = M(K, 7), F = L[0], q = L[1], Z = 19; Z > 4 && !F[u[Z - 1]]; --Z);
            var H,
                z,
                W,
                V,
                G = (d + 5) << 3,
                Y = U(i, w) + U(c, _) + l,
                Q =
                    U(i, m) +
                    U(c, k) +
                    l +
                    14 +
                    3 * Z +
                    U(K, F) +
                    (2 * K[16] + 3 * K[17] + 7 * K[18]);
            if (G <= Y && G <= Q) return N(t, p, e.subarray(h, h + d));
            if ((I(t, p, 1 + (Q < Y)), (p += 2), Q < Y)) {
                (H = b(m, v, 0)), (z = m), (W = b(k, A, 0)), (V = k);
                var J = b(F, q, 0);
                I(t, p, P - 257), I(t, p + 5, j - 1), I(t, p + 10, Z - 4), (p += 14);
                for (T = 0; T < Z; ++T) I(t, p + 3 * T, F[u[T]]);
                p += 3 * Z;
                for (var X = [C, B], $ = 0; $ < 2; ++$) {
                    var ee = X[$];
                    for (T = 0; T < ee.length; ++T) {
                        var te = 31 & ee[T];
                        I(t, p, J[te]),
                            (p += F[te]),
                            te > 15 && (I(t, p, (ee[T] >>> 5) & 127), (p += ee[T] >>> 12));
                    }
                }
            } else (H = E), (z = w), (W = x), (V = _);
            for (T = 0; T < f; ++T)
                if (r[T] > 255) {
                    te = (r[T] >>> 18) & 31;
                    R(t, p, H[te + 257]),
                        (p += z[te + 257]),
                        te > 7 && (I(t, p, (r[T] >>> 23) & 31), (p += a[te]));
                    var ne = 31 & r[T];
                    R(t, p, W[ne]),
                        (p += V[ne]),
                        ne > 3 && (R(t, p, (r[T] >>> 5) & 8191), (p += s[ne]));
                } else R(t, p, H[r[T]]), (p += z[r[T]]);
            return R(t, p, H[256]), p + z[256];
        },
        q = new i([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]),
        Z = new r(0),
        H = function (e, t, n, u, c, l) {
            var f = e.length,
                d = new r(u + f + 5 * (1 + Math.ceil(f / 7e3)) + c),
                p = d.subarray(u, d.length - c),
                m = 0;
            if (!t || f < 8)
                for (var v = 0; v <= f; v += 65535) {
                    var g = v + 65535;
                    g >= f && (p[m >> 3] = l), (m = N(p, m + 1, e.subarray(v, g)));
                }
            else {
                for (
                    var b = q[t - 1],
                        w = b >>> 13,
                        _ = 8191 & b,
                        E = (1 << n) - 1,
                        k = new o(32768),
                        x = new o(E + 1),
                        A = Math.ceil(n / 3),
                        S = 2 * A,
                        C = function (t) {
                            return (e[t] ^ (e[t + 1] << A) ^ (e[t + 2] << S)) & E;
                        },
                        P = new i(25e3),
                        j = new o(288),
                        K = new o(32),
                        T = 0,
                        I = 0,
                        R = ((v = 0), 0),
                        M = 0,
                        L = 0;
                    v < f;
                    ++v
                ) {
                    var D = C(v),
                        U = 32767 & v,
                        H = x[D];
                    if (((k[U] = H), (x[D] = U), M <= v)) {
                        var z = f - v;
                        if ((T > 7e3 || R > 24576) && z > 423) {
                            (m = F(e, p, 0, P, j, K, I, R, L, v - L, m)), (R = T = I = 0), (L = v);
                            for (var W = 0; W < 286; ++W) j[W] = 0;
                            for (W = 0; W < 30; ++W) K[W] = 0;
                        }
                        var V = 2,
                            G = 0,
                            Y = _,
                            Q = (U - H) & 32767;
                        if (z > 2 && D == C(v - Q))
                            for (
                                var J = Math.min(w, z) - 1,
                                    X = Math.min(32767, v),
                                    $ = Math.min(258, z);
                                Q <= X && --Y && U != H;

                            ) {
                                if (e[v + V] == e[v + V - Q]) {
                                    for (var ee = 0; ee < $ && e[v + ee] == e[v + ee - Q]; ++ee);
                                    if (ee > V) {
                                        if (((V = ee), (G = Q), ee > J)) break;
                                        var te = Math.min(Q, ee - 2),
                                            ne = 0;
                                        for (W = 0; W < te; ++W) {
                                            var re = (v - Q + W + 32768) & 32767,
                                                oe = (re - k[re] + 32768) & 32767;
                                            oe > ne && ((ne = oe), (H = re));
                                        }
                                    }
                                }
                                Q += ((U = H) - (H = k[U]) + 32768) & 32767;
                            }
                        if (G) {
                            P[R++] = 268435456 | (h[V] << 18) | y[G];
                            var ie = 31 & h[V],
                                ae = 31 & y[G];
                            (I += a[ie] + s[ae]), ++j[257 + ie], ++K[ae], (M = v + V), ++T;
                        } else (P[R++] = e[v]), ++j[e[v]];
                    }
                }
                (m = F(e, p, l, P, j, K, I, R, L, v - L, m)), !l && 7 & m && (m = N(p, m + 1, Z));
            }
            return B(d, 0, u + O(m) + c);
        },
        z =
            6728 != n.j
                ? (function () {
                      for (var e = new Int32Array(256), t = 0; t < 256; ++t) {
                          for (var n = t, r = 9; --r; ) n = (1 & n && -306674912) ^ (n >>> 1);
                          e[t] = n;
                      }
                      return e;
                  })()
                : null,
        W = function () {
            var e = -1;
            return {
                p: function (t) {
                    for (var n = e, r = 0; r < t.length; ++r) n = z[(255 & n) ^ t[r]] ^ (n >>> 8);
                    e = n;
                },
                d: function () {
                    return ~e;
                },
            };
        },
        V = function (e, t, n, r, o) {
            return H(
                e,
                null == t.level ? 6 : t.level,
                null == t.mem
                    ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(e.length))))
                    : 12 + t.mem,
                n,
                r,
                !o
            );
        },
        G = function (e, t, n) {
            for (; n; ++t) (e[t] = n), (n >>>= 8);
        },
        Y = function (e, t) {
            var n = t.filename;
            if (
                ((e[0] = 31),
                (e[1] = 139),
                (e[2] = 8),
                (e[8] = t.level < 2 ? 4 : 9 == t.level ? 2 : 0),
                (e[9] = 3),
                0 != t.mtime && G(e, 4, Math.floor(new Date(t.mtime || Date.now()) / 1e3)),
                n)
            ) {
                e[3] = 8;
                for (var r = 0; r <= n.length; ++r) e[r + 10] = n.charCodeAt(r);
            }
        },
        Q = function (e) {
            (31 == e[0] && 139 == e[1] && 8 == e[2]) || K(6, "invalid gzip data");
            var t = e[3],
                n = 10;
            4 & t && (n += e[10] | (2 + (e[11] << 8)));
            for (var r = ((t >> 3) & 1) + ((t >> 4) & 1); r > 0; r -= !e[n++]);
            return n + (2 & t);
        },
        J = function (e) {
            var t = e.length;
            return (e[t - 4] | (e[t - 3] << 8) | (e[t - 2] << 16) | (e[t - 1] << 24)) >>> 0;
        },
        X = function (e) {
            return 10 + ((e.filename && e.filename.length + 1) || 0);
        },
        $ = function (e) {
            (8 != (15 & e[0]) || e[0] >>> 4 > 7 || ((e[0] << 8) | e[1]) % 31) &&
                K(6, "invalid zlib data"),
                32 & e[1] && K(6, "invalid zlib data: preset dictionaries not supported");
        };
    function ee(e, t) {
        return T(e, t);
    }
    function te(e, t) {
        t || (t = {});
        var n = W(),
            r = e.length;
        n.p(e);
        var o = V(e, t, X(t), 8),
            i = o.length;
        return Y(o, t), G(o, i - 8, n.d()), G(o, i - 4, r), o;
    }
    function ne(e, t) {
        return T(e.subarray(Q(e), -8), t || new r(J(e)));
    }
    function re(e, t) {
        return T(($(e), e.subarray(2, -4)), t);
    }

    function oe(e, t) {
        return 31 == e[0] && 139 == e[1] && 8 == e[2]
            ? ne(e, t)
            : 8 != (15 & e[0]) || e[0] >> 4 > 7 || ((e[0] << 8) | e[1]) % 31
            ? ee(e, t)
            : re(e, t);
    }
    var ie = "undefined" != typeof TextEncoder && new TextEncoder(),
        ae = "undefined" != typeof TextDecoder && new TextDecoder();
    try {
        ae.decode(Z, {
            stream: !0,
        }),
            1;
    } catch (ue) {}
    function se(e, t) {
        if (t) {
            for (var n = new r(e.length), o = 0; o < e.length; ++o) n[o] = e.charCodeAt(o);
            return n;
        }
        if (ie) return ie.encode(e);
        var i = e.length,
            a = new r(e.length + (e.length >> 1)),
            s = 0,
            u = function (e) {
                a[s++] = e;
            };
        for (o = 0; o < i; ++o) {
            if (s + 5 > a.length) {
                var c = new r(s + 8 + ((i - o) << 1));
                c.set(a), (a = c);
            }
            var l = e.charCodeAt(o);
            l < 128 || t
                ? u(l)
                : l < 2048
                ? (u(192 | (l >> 6)), u(128 | (63 & l)))
                : l > 55295 && l < 57344
                ? (u(240 | ((l = (65536 + (1047552 & l)) | (1023 & e.charCodeAt(++o))) >> 18)),
                  u(128 | ((l >> 12) & 63)),
                  u(128 | ((l >> 6) & 63)),
                  u(128 | (63 & l)))
                : (u(224 | (l >> 12)), u(128 | ((l >> 6) & 63)), u(128 | (63 & l)));
        }
        return B(a, 0, s);
    }
    return {
        formatterData: oe,
    };
}

export default dingdingTool;
